package com.onion.loan.user.controller;

import com.onion.loan.user.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.data.redis.core.ValueOperations;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created by Administrator on 2018/11/24 0024.
 */
@RestController
@RequestMapping("/user")
public class UserController {

    @Autowired
    UserService userService;

    @Autowired
    StringRedisTemplate redis;
    @GetMapping("/test")
    public String test(){
        ValueOperations<String, String> s = redis.opsForValue();
        s.set("zhangqi","3");
        String zhangqi = s.get("zhangqi");
        return zhangqi;
    }

}
